#ifndef __QF_EPOLL_EVENT_H__
#define __QF_EPOLL_EVENT_H__

#include <queue>
#include <list>
#include <vector>
#include "QF_event.h"
using std::priority_queue;
using std::list;
using std::vector;

class qf_epoll_base : public qf_event_base {
public:
	qf_epoll_base ();
	~qf_epoll_base ();

	qf_event_p event_new (int, short, void (*));
	EVerr event_add (qf_event_p, long);
	EVerr event_remove (qf_event_p);
	EVerr event_del (qf_event_p);
	EVerr event_dispatch ();
private:
	void release_time_queue ();
	int epfd;
	list<qf_event_p> active;
	list<qf_event_p> events;
	long current_time;
	priority_queue<qf_event_p> time_queue;
};
#endif
